import { useKline } from "@/stores/kline";
import { useLayout } from "@/stores/layout";
function top(element: HTMLElement) {
    element.scrollTop = 0;
}
function onScroll(ent: Event) {
    const kline = useKline();
    const layout = useLayout();
    const top = (ent.target as HTMLDivElement).scrollTop;
    // console.log('yzt', top, window.innerHeight);
    if (top > window.innerHeight * 0.7) {
        kline.chilageTableRecommend(false);
        kline.changeLinkVisible(false);
        layout.changeIsToTop(true);
    }
    else {
        layout.changeIsToTop(false);
    }
}
function reload(ent?: any) {
    console.log('点击分享',ent)
    let temp : any = new Date().getTime()
    if(ent=='twitter'){
        localStorage.setItem('shareTwTime', String(new Date(temp).getDate()))
    }else{
        localStorage.setItem('shareTgTime', String(new Date(temp).getDate()))
    }
    location.reload();
}
export { top, onScroll, reload }; 